﻿<UserControl x:Class="WebberCross.Obelisk.MvvmLightDemo.View.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="200"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <TextBlock Text="People:" Style="{StaticResource PhoneTextAccentStyle}" />
        <ListBox Grid.Row="1" ItemsSource="{Binding Path=People, Mode=OneWay}" SelectedItem="{Binding Path=Person, Mode=TwoWay}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="12,0,0,0" Text="{Binding Path=Name, Mode=OneWay}" />
                        <TextBlock Margin="10,0,0,0" Text="{Binding Path=Birthday, Mode=OneWay}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                </Style>
            </ListBox.ItemContainerStyle>
        </ListBox>

        <TextBlock Grid.Row="2" Text="Selection:" Style="{StaticResource PhoneTextAccentStyle}" />
        <StackPanel  Grid.Row="3" Orientation="Horizontal">
            <TextBlock Margin="10,0,0,0" Text="{Binding Path=Person.Name, Mode=OneWay, FallbackValue=[None selected]}" />
            <TextBlock Margin="10,0,0,0" Text="{Binding Path=Person.Birthday, Mode=OneWay}" />
        </StackPanel>

        <TextBlock Grid.Row="4" Text="Notes:" Style="{StaticResource PhoneTextAccentStyle}" />
        <TextBox Grid.Row="5" Text="{Binding Path=Notes, Mode=TwoWay}" />
    </Grid>
</UserControl>
